package org.sdp.pearproject.dao.domain;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * InterfaceName: EventsMemberExample
 * @Description:
 * @Author: SDP
 * @Date: 2022-08-05
 * @Version: 1.0
 * Table: pear_events_member
 * Comment:
 * 日程-成员表
 */
public class EventsMemberExample extends BaseExample {
    protected Integer limitClause;

    protected Integer countClause;

    protected Integer topClause;

    protected CriteriaString setNull;

    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    public EventsMemberExample() {
        oredCriteria = new ArrayList<>();
    }

    public void setLimitClause(Integer limitClause) {
        this.limitClause = limitClause;
    }

    public Integer getLimitClause() {
        return limitClause;
    }

    public void setCountClause(Integer countClause) {
        this.countClause = countClause;
    }

    public Integer getCountClause() {
        return countClause;
    }

    public void setTopClause(Integer topClause) {
        this.topClause = topClause;
    }

    public Integer getTopClause() {
        return topClause;
    }

    public CriteriaString getSetNull() {
        return setNull;
    }

    public void setSetNull(CriteriaString setNull) {
        this.setNull = setNull;
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    public static EventsMemberExample createExample(EventsMember request) throws Exception {
        return createExample(request, null);
    }

    public static EventsMemberExample createExample(EventsMember request, JSONObject options) throws Exception {
        EventsMemberExample example = new EventsMemberExample();
        EventsMemberExample.Criteria criteria = example.createCriteria();

        example.fixExample(EventsMember.class, CriteriaString.class, criteria, options);

        example.fixExample("EqualTo", 1, request, criteria);        

        if (options != null) {
            String orderBy = "";
            if (options.containsKey("order_by")) {
                orderBy = setCriteriaOrderBy(options.getJSONArray("order_by"), example);
                if (orderBy.length() > 0) {
                    example.setOrderByClause(orderBy);
                }
            }
        }

        return example;
    }

    private static String setCriteriaOrderBy(JSONArray jsonArray, EventsMemberExample example) throws Exception {
        List<Object> request = Criterion.toList(jsonArray, CriteriaString.class);
        StringBuilder sb = new StringBuilder();
        int count = 0;
        for(int i = 0; i < request.size(); i++) {
            Object criteriaOrderByObj  = request.get(i);
            CriteriaString criteriaOrderBy = (CriteriaString)criteriaOrderByObj;
            int subCount = 0;

            subCount += appendCriteriaOrderByItem(sb, "id", criteriaOrderBy.getId());
            subCount += appendCriteriaOrderByItem(sb, "events_code", criteriaOrderBy.getEventsCode());
            subCount += appendCriteriaOrderByItem(sb, "member_code", criteriaOrderBy.getMemberCode());
            subCount += appendCriteriaOrderByItem(sb, "join_time", criteriaOrderBy.getJoinTime());
            subCount += appendCriteriaOrderByItem(sb, "is_owner", criteriaOrderBy.getIsOwner());
            subCount += appendCriteriaOrderByItem(sb, "project_code", criteriaOrderBy.getProjectCode());
            subCount += appendCriteriaOrderByItem(sb, "`status`", criteriaOrderBy.getStatus());
            subCount += appendCriteriaOrderByItem(sb, "confirm_time", criteriaOrderBy.getConfirmTime());
            if (subCount > 1) {
                throw new Exception("order by数组元素对象属性多于1个(EventsMemberExample):"+count+","+JSON.toJSONString(jsonArray.get(i)));
            }
            if (subCount == 0 && !"{}".equals(JSON.toJSONString(jsonArray.get(i)))) {
                throw new Exception("存在非法order by 字段(EventsMemberExample):"+count+","+JSON.toJSONString(jsonArray.get(i)));
            }
            count++;
        }
        if (sb.length() == 0) {
            appendCriteriaOrderByItem(sb, "1", "");
        }

        return sb.toString();
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        public Criteria andIdIsNull() {
            addCriterion("id is null");
            return (Criteria) this;
        }

        public Criteria andIdIsNotNull() {
            addCriterion("id is not null");
            return (Criteria) this;
        }

        public Criteria andIdEqualTo(Integer value) {
            addCriterion("id =", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotEqualTo(Integer value) {
            addCriterion("id <>", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThan(Integer value) {
            addCriterion("id >", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThanOrEqualTo(Integer value) {
            addCriterion("id >=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThan(Integer value) {
            addCriterion("id <", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThanOrEqualTo(Integer value) {
            addCriterion("id <=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdIn(List<Integer> values) {
            addCriterion("id in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotIn(List<Integer> values) {
            addCriterion("id not in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdBetween(Integer value1, Integer value2) {
            addCriterion("id between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotBetween(Integer value1, Integer value2) {
            addCriterion("id not between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andEventsCodeIsNull() {
            addCriterion("events_code is null");
            return (Criteria) this;
        }

        public Criteria andEventsCodeIsNotNull() {
            addCriterion("events_code is not null");
            return (Criteria) this;
        }

        public Criteria andEventsCodeEqualTo(String value) {
            addCriterion("events_code =", value, "eventsCode");
            return (Criteria) this;
        }

        public Criteria andEventsCodeNotEqualTo(String value) {
            addCriterion("events_code <>", value, "eventsCode");
            return (Criteria) this;
        }

        public Criteria andEventsCodeGreaterThan(String value) {
            addCriterion("events_code >", value, "eventsCode");
            return (Criteria) this;
        }

        public Criteria andEventsCodeGreaterThanOrEqualTo(String value) {
            addCriterion("events_code >=", value, "eventsCode");
            return (Criteria) this;
        }

        public Criteria andEventsCodeLessThan(String value) {
            addCriterion("events_code <", value, "eventsCode");
            return (Criteria) this;
        }

        public Criteria andEventsCodeLessThanOrEqualTo(String value) {
            addCriterion("events_code <=", value, "eventsCode");
            return (Criteria) this;
        }

        public Criteria andEventsCodeRegexp(String value) {
            addCriterion("events_code regexp", value, "eventsCode");
            return (Criteria) this;
        }

        public Criteria andEventsCodeLike(String value) {
            addCriterion("events_code like", value, "eventsCode");
            return (Criteria) this;
        }

        public Criteria andEventsCodeNotLike(String value) {
            addCriterion("events_code not like", value, "eventsCode");
            return (Criteria) this;
        }

        public Criteria andEventsCodeIn(List<String> values) {
            addCriterion("events_code in", values, "eventsCode");
            return (Criteria) this;
        }

        public Criteria andEventsCodeNotIn(List<String> values) {
            addCriterion("events_code not in", values, "eventsCode");
            return (Criteria) this;
        }

        public Criteria andEventsCodeBetween(String value1, String value2) {
            addCriterion("events_code between", value1, value2, "eventsCode");
            return (Criteria) this;
        }

        public Criteria andEventsCodeNotBetween(String value1, String value2) {
            addCriterion("events_code not between", value1, value2, "eventsCode");
            return (Criteria) this;
        }

        public Criteria andMemberCodeIsNull() {
            addCriterion("member_code is null");
            return (Criteria) this;
        }

        public Criteria andMemberCodeIsNotNull() {
            addCriterion("member_code is not null");
            return (Criteria) this;
        }

        public Criteria andMemberCodeEqualTo(String value) {
            addCriterion("member_code =", value, "memberCode");
            return (Criteria) this;
        }

        public Criteria andMemberCodeNotEqualTo(String value) {
            addCriterion("member_code <>", value, "memberCode");
            return (Criteria) this;
        }

        public Criteria andMemberCodeGreaterThan(String value) {
            addCriterion("member_code >", value, "memberCode");
            return (Criteria) this;
        }

        public Criteria andMemberCodeGreaterThanOrEqualTo(String value) {
            addCriterion("member_code >=", value, "memberCode");
            return (Criteria) this;
        }

        public Criteria andMemberCodeLessThan(String value) {
            addCriterion("member_code <", value, "memberCode");
            return (Criteria) this;
        }

        public Criteria andMemberCodeLessThanOrEqualTo(String value) {
            addCriterion("member_code <=", value, "memberCode");
            return (Criteria) this;
        }

        public Criteria andMemberCodeRegexp(String value) {
            addCriterion("member_code regexp", value, "memberCode");
            return (Criteria) this;
        }

        public Criteria andMemberCodeLike(String value) {
            addCriterion("member_code like", value, "memberCode");
            return (Criteria) this;
        }

        public Criteria andMemberCodeNotLike(String value) {
            addCriterion("member_code not like", value, "memberCode");
            return (Criteria) this;
        }

        public Criteria andMemberCodeIn(List<String> values) {
            addCriterion("member_code in", values, "memberCode");
            return (Criteria) this;
        }

        public Criteria andMemberCodeNotIn(List<String> values) {
            addCriterion("member_code not in", values, "memberCode");
            return (Criteria) this;
        }

        public Criteria andMemberCodeBetween(String value1, String value2) {
            addCriterion("member_code between", value1, value2, "memberCode");
            return (Criteria) this;
        }

        public Criteria andMemberCodeNotBetween(String value1, String value2) {
            addCriterion("member_code not between", value1, value2, "memberCode");
            return (Criteria) this;
        }

        public Criteria andJoinTimeIsNull() {
            addCriterion("join_time is null");
            return (Criteria) this;
        }

        public Criteria andJoinTimeIsNotNull() {
            addCriterion("join_time is not null");
            return (Criteria) this;
        }

        public Criteria andJoinTimeEqualTo(String value) {
            addCriterion("join_time =", value, "joinTime");
            return (Criteria) this;
        }

        public Criteria andJoinTimeNotEqualTo(String value) {
            addCriterion("join_time <>", value, "joinTime");
            return (Criteria) this;
        }

        public Criteria andJoinTimeGreaterThan(String value) {
            addCriterion("join_time >", value, "joinTime");
            return (Criteria) this;
        }

        public Criteria andJoinTimeGreaterThanOrEqualTo(String value) {
            addCriterion("join_time >=", value, "joinTime");
            return (Criteria) this;
        }

        public Criteria andJoinTimeLessThan(String value) {
            addCriterion("join_time <", value, "joinTime");
            return (Criteria) this;
        }

        public Criteria andJoinTimeLessThanOrEqualTo(String value) {
            addCriterion("join_time <=", value, "joinTime");
            return (Criteria) this;
        }

        public Criteria andJoinTimeRegexp(String value) {
            addCriterion("join_time regexp", value, "joinTime");
            return (Criteria) this;
        }

        public Criteria andJoinTimeLike(String value) {
            addCriterion("join_time like", value, "joinTime");
            return (Criteria) this;
        }

        public Criteria andJoinTimeNotLike(String value) {
            addCriterion("join_time not like", value, "joinTime");
            return (Criteria) this;
        }

        public Criteria andJoinTimeIn(List<String> values) {
            addCriterion("join_time in", values, "joinTime");
            return (Criteria) this;
        }

        public Criteria andJoinTimeNotIn(List<String> values) {
            addCriterion("join_time not in", values, "joinTime");
            return (Criteria) this;
        }

        public Criteria andJoinTimeBetween(String value1, String value2) {
            addCriterion("join_time between", value1, value2, "joinTime");
            return (Criteria) this;
        }

        public Criteria andJoinTimeNotBetween(String value1, String value2) {
            addCriterion("join_time not between", value1, value2, "joinTime");
            return (Criteria) this;
        }

        public Criteria andIsOwnerIsNull() {
            addCriterion("is_owner is null");
            return (Criteria) this;
        }

        public Criteria andIsOwnerIsNotNull() {
            addCriterion("is_owner is not null");
            return (Criteria) this;
        }

        public Criteria andIsOwnerEqualTo(Integer value) {
            addCriterion("is_owner =", value, "isOwner");
            return (Criteria) this;
        }

        public Criteria andIsOwnerNotEqualTo(Integer value) {
            addCriterion("is_owner <>", value, "isOwner");
            return (Criteria) this;
        }

        public Criteria andIsOwnerGreaterThan(Integer value) {
            addCriterion("is_owner >", value, "isOwner");
            return (Criteria) this;
        }

        public Criteria andIsOwnerGreaterThanOrEqualTo(Integer value) {
            addCriterion("is_owner >=", value, "isOwner");
            return (Criteria) this;
        }

        public Criteria andIsOwnerLessThan(Integer value) {
            addCriterion("is_owner <", value, "isOwner");
            return (Criteria) this;
        }

        public Criteria andIsOwnerLessThanOrEqualTo(Integer value) {
            addCriterion("is_owner <=", value, "isOwner");
            return (Criteria) this;
        }

        public Criteria andIsOwnerIn(List<Integer> values) {
            addCriterion("is_owner in", values, "isOwner");
            return (Criteria) this;
        }

        public Criteria andIsOwnerNotIn(List<Integer> values) {
            addCriterion("is_owner not in", values, "isOwner");
            return (Criteria) this;
        }

        public Criteria andIsOwnerBetween(Integer value1, Integer value2) {
            addCriterion("is_owner between", value1, value2, "isOwner");
            return (Criteria) this;
        }

        public Criteria andIsOwnerNotBetween(Integer value1, Integer value2) {
            addCriterion("is_owner not between", value1, value2, "isOwner");
            return (Criteria) this;
        }

        public Criteria andProjectCodeIsNull() {
            addCriterion("project_code is null");
            return (Criteria) this;
        }

        public Criteria andProjectCodeIsNotNull() {
            addCriterion("project_code is not null");
            return (Criteria) this;
        }

        public Criteria andProjectCodeEqualTo(String value) {
            addCriterion("project_code =", value, "projectCode");
            return (Criteria) this;
        }

        public Criteria andProjectCodeNotEqualTo(String value) {
            addCriterion("project_code <>", value, "projectCode");
            return (Criteria) this;
        }

        public Criteria andProjectCodeGreaterThan(String value) {
            addCriterion("project_code >", value, "projectCode");
            return (Criteria) this;
        }

        public Criteria andProjectCodeGreaterThanOrEqualTo(String value) {
            addCriterion("project_code >=", value, "projectCode");
            return (Criteria) this;
        }

        public Criteria andProjectCodeLessThan(String value) {
            addCriterion("project_code <", value, "projectCode");
            return (Criteria) this;
        }

        public Criteria andProjectCodeLessThanOrEqualTo(String value) {
            addCriterion("project_code <=", value, "projectCode");
            return (Criteria) this;
        }

        public Criteria andProjectCodeRegexp(String value) {
            addCriterion("project_code regexp", value, "projectCode");
            return (Criteria) this;
        }

        public Criteria andProjectCodeLike(String value) {
            addCriterion("project_code like", value, "projectCode");
            return (Criteria) this;
        }

        public Criteria andProjectCodeNotLike(String value) {
            addCriterion("project_code not like", value, "projectCode");
            return (Criteria) this;
        }

        public Criteria andProjectCodeIn(List<String> values) {
            addCriterion("project_code in", values, "projectCode");
            return (Criteria) this;
        }

        public Criteria andProjectCodeNotIn(List<String> values) {
            addCriterion("project_code not in", values, "projectCode");
            return (Criteria) this;
        }

        public Criteria andProjectCodeBetween(String value1, String value2) {
            addCriterion("project_code between", value1, value2, "projectCode");
            return (Criteria) this;
        }

        public Criteria andProjectCodeNotBetween(String value1, String value2) {
            addCriterion("project_code not between", value1, value2, "projectCode");
            return (Criteria) this;
        }

        public Criteria andStatusIsNull() {
            addCriterion("`status` is null");
            return (Criteria) this;
        }

        public Criteria andStatusIsNotNull() {
            addCriterion("`status` is not null");
            return (Criteria) this;
        }

        public Criteria andStatusEqualTo(Byte value) {
            addCriterion("`status` =", value, "status");
            return (Criteria) this;
        }

        public Criteria andStatusNotEqualTo(Byte value) {
            addCriterion("`status` <>", value, "status");
            return (Criteria) this;
        }

        public Criteria andStatusGreaterThan(Byte value) {
            addCriterion("`status` >", value, "status");
            return (Criteria) this;
        }

        public Criteria andStatusGreaterThanOrEqualTo(Byte value) {
            addCriterion("`status` >=", value, "status");
            return (Criteria) this;
        }

        public Criteria andStatusLessThan(Byte value) {
            addCriterion("`status` <", value, "status");
            return (Criteria) this;
        }

        public Criteria andStatusLessThanOrEqualTo(Byte value) {
            addCriterion("`status` <=", value, "status");
            return (Criteria) this;
        }

        public Criteria andStatusIn(List<Byte> values) {
            addCriterion("`status` in", values, "status");
            return (Criteria) this;
        }

        public Criteria andStatusNotIn(List<Byte> values) {
            addCriterion("`status` not in", values, "status");
            return (Criteria) this;
        }

        public Criteria andStatusBetween(Byte value1, Byte value2) {
            addCriterion("`status` between", value1, value2, "status");
            return (Criteria) this;
        }

        public Criteria andStatusNotBetween(Byte value1, Byte value2) {
            addCriterion("`status` not between", value1, value2, "status");
            return (Criteria) this;
        }

        public Criteria andConfirmTimeIsNull() {
            addCriterion("confirm_time is null");
            return (Criteria) this;
        }

        public Criteria andConfirmTimeIsNotNull() {
            addCriterion("confirm_time is not null");
            return (Criteria) this;
        }

        public Criteria andConfirmTimeEqualTo(String value) {
            addCriterion("confirm_time =", value, "confirmTime");
            return (Criteria) this;
        }

        public Criteria andConfirmTimeNotEqualTo(String value) {
            addCriterion("confirm_time <>", value, "confirmTime");
            return (Criteria) this;
        }

        public Criteria andConfirmTimeGreaterThan(String value) {
            addCriterion("confirm_time >", value, "confirmTime");
            return (Criteria) this;
        }

        public Criteria andConfirmTimeGreaterThanOrEqualTo(String value) {
            addCriterion("confirm_time >=", value, "confirmTime");
            return (Criteria) this;
        }

        public Criteria andConfirmTimeLessThan(String value) {
            addCriterion("confirm_time <", value, "confirmTime");
            return (Criteria) this;
        }

        public Criteria andConfirmTimeLessThanOrEqualTo(String value) {
            addCriterion("confirm_time <=", value, "confirmTime");
            return (Criteria) this;
        }

        public Criteria andConfirmTimeRegexp(String value) {
            addCriterion("confirm_time regexp", value, "confirmTime");
            return (Criteria) this;
        }

        public Criteria andConfirmTimeLike(String value) {
            addCriterion("confirm_time like", value, "confirmTime");
            return (Criteria) this;
        }

        public Criteria andConfirmTimeNotLike(String value) {
            addCriterion("confirm_time not like", value, "confirmTime");
            return (Criteria) this;
        }

        public Criteria andConfirmTimeIn(List<String> values) {
            addCriterion("confirm_time in", values, "confirmTime");
            return (Criteria) this;
        }

        public Criteria andConfirmTimeNotIn(List<String> values) {
            addCriterion("confirm_time not in", values, "confirmTime");
            return (Criteria) this;
        }

        public Criteria andConfirmTimeBetween(String value1, String value2) {
            addCriterion("confirm_time between", value1, value2, "confirmTime");
            return (Criteria) this;
        }

        public Criteria andConfirmTimeNotBetween(String value1, String value2) {
            addCriterion("confirm_time not between", value1, value2, "confirmTime");
            return (Criteria) this;
        }

    }

    public static class CriteriaString {
        //id
        @JsonProperty("id")
        @JSONField(name = "id")
        private String id;

        public String getId() {
            return id;
        }
    
        public void setId(String _v) {
            id = _v;
        }

        //项目id
        @JsonProperty("events_code")
        @JSONField(name = "events_code")
        private String eventsCode;

        public String getEventsCode() {
            return eventsCode;
        }
    
        public void setEventsCode(String _v) {
            eventsCode = _v;
        }

        //成员id
        @JsonProperty("member_code")
        @JSONField(name = "member_code")
        private String memberCode;

        public String getMemberCode() {
            return memberCode;
        }
    
        public void setMemberCode(String _v) {
            memberCode = _v;
        }

        //加入时间
        @JsonProperty("join_time")
        @JSONField(name = "join_time")
        private String joinTime;

        public String getJoinTime() {
            return joinTime;
        }
    
        public void setJoinTime(String _v) {
            joinTime = _v;
        }

        //拥有者
        @JsonProperty("is_owner")
        @JSONField(name = "is_owner")
        private String isOwner;

        public String getIsOwner() {
            return isOwner;
        }
    
        public void setIsOwner(String _v) {
            isOwner = _v;
        }

        //项目id
        @JsonProperty("project_code")
        @JSONField(name = "project_code")
        private String projectCode;

        public String getProjectCode() {
            return projectCode;
        }
    
        public void setProjectCode(String _v) {
            projectCode = _v;
        }

        //确认状态
        @JsonProperty("status")
        @JSONField(name = "status")
        private String status;

        public String getStatus() {
            return status;
        }
    
        public void setStatus(String _v) {
            status = _v;
        }

        //确认时间
        @JsonProperty("confirm_time")
        @JSONField(name = "confirm_time")
        private String confirmTime;

        public String getConfirmTime() {
            return confirmTime;
        }
    
        public void setConfirmTime(String _v) {
            confirmTime = _v;
        }

    }

    public static class Criteria extends GeneratedCriteria {
        protected Criteria() {
            super();
        }
    }
}
